package com.piece.module.file.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@ApiModel(value = "系统文件模型")
public class SysFileDTO implements Serializable {

    @ApiModelProperty(value = "主键")
    private String fileId;

    @ApiModelProperty(value = "业务主键")
    private String businessId;

    @ApiModelProperty(value = "业务表")
    private String table;

    @ApiModelProperty(name = "md5签名")
    private String md5;

    @ApiModelProperty(name = "server_id")
    private String serverId;

    @ApiModelProperty(name = "云存储目录")
    private String serverPath;

    @ApiModelProperty(name = "本地路径")
    private String localPath;

    @ApiModelProperty(name = "文件流")
    private InputStream fileInputStream;

    @ApiModelProperty(value = "文件原始名称")
    private String originalFilename;

    @ApiModelProperty(value = "文件存储名称")
    private String serverFileName;

    @ApiModelProperty(value = "文件扩展名")
    private String contentType;

    @ApiModelProperty(value = "文件类别", notes = "1=图片, 2=文档, 3=音频, 4=视频, 5=模板, 0=其它")
    private String channel;

    @ApiModelProperty(value = "文件大小")
    private Long fileSize;

    @ApiModelProperty(value = "文件时长")
    private Long duration;

    @ApiModelProperty(value = "上传时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date uploadTime;

    @ApiModelProperty(value = "上传人")
    private String createBy;

    @ApiModelProperty(value = "是否文件夹")
    private boolean isDir;
}
